<template>
  <div>
    <!-- <h3>这是子组件{{ value }}</h3> -->
    <h3>这是子组件{{ a }}</h3>
    <h3>这是子组件{{ b }}</h3>
    <button @click="add">+1</button>
  </div>
</template>

<script>
export default {
  props: {
    // value: {
    //   type: Number,
    //   required: true
    // },
    a: {
      type: Number,
      required: true
    },
    b: {
      type: Number,
      required: true
    }
  },
  data() {
    return {
      num2: this.value,
      aa: this.a,
      bb: this.b
    }
  },
  methods: {
    add() {
      // this.$emit('input', this.num2++)
      this.$emit('update:a', ++this.aa)
      this.$emit('update:b', ++this.bb)
    }
  }
}
</script>

<style>

</style>
